package cn.webr;

import org.jsoup.Jsoup;

import javax.swing.*;
import java.io.IOException;

public class Dict {
    public static void main(String[] args) throws IOException {
        String w = JOptionPane.showInputDialog("请输入词汇：");
        String u = "http://www.youdao.com/w/eng/"+w+"/#keyfrom=dict2.index";
        u = "https://cn.bing.com/dict/search?q="+w;
        //String o = Jsoup.connect(u).get().select("div[class=trans-container]").get(0).text();
        String o = Jsoup.connect(u).get().select("span[class=def b_regtxt]").get(0).text();
        JOptionPane.showMessageDialog(null,o);
    }
}
